<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>学生换房-宿管系统</title>
    <link rel="stylesheet" href="../../css/basicLayout.css">

    <style type="text/css">
        #studentChangeRoom{
            width: 500px;
            height: 500px;
            margin: 0 auto;
        }

        #studentChangeRoom form table{
            padding-top: 50px;
            line-height: 50px;
        }

    </style>
</head>
<body>

<!--    头部，用来放导航栏-->
<div id="header">
    <ul>
        <li><a href="${pageContext.request.contextPath}/student/index"> 学生管理</a></li>
        <li><a href="${pageContext.request.contextPath}/class/index"> 班级管理</a></li>
        <li><a href="${pageContext.request.contextPath}/room/index"> 房间管理</a></li>
    </ul>
</div>

<!--子导航栏区域-->
<div id="child">
    <label>学生管理功能</label>
    <ul>

        <li><a href="${pageContext.request.contextPath}/student/add/index">学生入住</a></li>
    </ul>
</div>

<!--主体内容区域-->
<div id="content">
    <!--学生详情表单-->
    <div id="studentChangeRoom">
        <form action="/student/changeRoom/execute" method="POST">
            <table>
                <tr>
                    <input type="hidden" name="stuId" value="${student.studentId}"/>
                    <td>姓名：</td>
                    <td>${student.studentName}</td>
                </tr>
                <tr>
                    <td>性别：</td>
                    <td>
                        <c:if test="${student.studentSex==0}">
                            女
                        </c:if>
                        <c:if test="${student.studentSex==1}">
                            男
                        </c:if>
                    </td>
                </tr>
                <tr>
                    <td>班级：</td>
                    <td>${student.myClass.className}</td>
                </tr>
                <tr>
                    <td>原房间：</td>
                    <input type="hidden" name="oldRoomName" value="${student.myRoom.roomAddress}"/>
                    <td>${student.myRoom.roomAddress}</td>
                </tr>
                <tr>
                    <td>新房间：</td>
                    <td>
                        <select name="newRoomName">
                            <c:forEach items="${rooms}" var="room">
                                <option value="${room.roomAddress}">${room.roomAddress}</option>
                            </c:forEach>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td rowspan="2"><input type="submit" value="确定更换" ></td>

                    <td rowspan="2"><a href="${pageContext.request.contextPath}/student/index" ><input type="button" value="返回主菜单" ></a></td>
                </tr>
            </table>

        </form>
    </div>
</div>

<!--页脚内容区域-->
<div id="footer">页脚</div>
</body>
</html>
